﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcContrib.UI.Grid;

namespace Enail.UI
{
    public class AlwaysRenderHeaderRenderer<T>
    : HtmlTableGridRenderer<T> where T : class
    {
        protected override bool ShouldRenderHeader()
        {
            return true;
        }
        protected override void RenderEmpty()
        {
            RenderHeadStart();
            foreach (var column in VisibleColumns())
            {
                RenderHeaderCellStart(column);
                RenderHeaderText(column);
                RenderHeaderCellEnd();
            }
            RenderHeadEnd();
            RenderBodyStart();
            RenderText("<tr><td>" + GridModel.EmptyText + "</td></tr>");
            RenderBodyEnd();
        }
    }

}
